package com.zengzhuo.cn;

import com.zengzhuo.cn.task.FileTask;
import org.apache.commons.io.FileUtils;

import javax.imageio.ImageIO;
import javax.imageio.ImageReader;
import javax.imageio.stream.ImageInputStream;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Hello world!
 */
public class App {


    public static void main(String[] args) {
        ExecutorService fixedThreadPool = Executors.newFixedThreadPool(50);

        String path = "G:\\tencent\\MicroMsg\\cdf55a8299bc054dedcfe08786e6b739\\image2";
        System.out.println("Hello World!");
//        getAllFileType();
        File file = new File(path);
        if (file.isDirectory()) {
            File[] files = file.listFiles();
            for (int i = 0; i < files.length; i++) {
                if (files[i].isDirectory()) {
                    String fielPath = files[i].getPath();
                    System.out.println("文件目录：" + files[i].getPath());
                    fixedThreadPool.execute(new FileTask(fielPath));
                }else {
                    System.out.println("文件不处理：" + files[i].getPath());
                }

            }
        }
//        getFiles(path);
    }


}
